import appModel, { appActions } from './app';
import countModel, { countActions } from './count';
import numModel, { numActions } from './num';
import errorHandler from './utils/errorHandler';

export { appModel, countModel, numModel, errorHandler };

export const ACTIONS = {
    APP: appActions,
    COUNT: countActions,
    NUM: numActions,
};

const modelHandler = (appInstance: any) => {
    [appModel, countModel, numModel].forEach((model) => {
        appInstance.model(model);
    });
};

export default modelHandler;
